import React, { Component } from 'react';
import 'common/components/commentItem.less';

class CommentItem extends Component{
	render(){
		const { comment } = this.props;
		let avatar = "http://statics.zhuishushenqi.com"+comment.author.avatar;
		let createdTime = comment.created.replace(/T/g,' ').replace(/\.[\d]{3}Z/,'')  
		return(
			<div>
				<div className="book_comment_item">
					<div className="book_comment_head">
						<div className="book_comment_user">
							<img src={avatar} />
							<span>{comment.author.nickname}</span>
						</div>
						<div className="book_comment_praise">
							<span>34</span>
							<img src='assets/img/praise.png'/>
						</div>
					</div>
					<div className="book_comment_content">
						{comment.content}
					</div>
					<div className="book_comment_time">
						{createdTime}
					</div>
				</div>
			</div>
		)
	}
}

export default CommentItem;